package com.example.yjhplayer.controller;

import com.example.common.vo.Result;

import com.example.yjhplayer.client.MatchClient;
import com.example.yjhplayer.client.teamClient;
import com.example.yjhplayer.mapper.StatisticsMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ly
 * @since 2023-07-25
 */
@RestController
@RequestMapping("/yjhplayer/statistics")
public class StatisticsController {
    @Resource
     teamClient teamClient;
    @RequestMapping("player")
    public Result queryplayer(@RequestParam("player_id") int playerId){
        return  teamClient.queryplayer(playerId);
    }
    @Resource
    StatisticsMapper statisticsMapper;
    @RequestMapping("hero")
    public  Result queryhero(@RequestParam("player_id") int playerId){
        return  Result.success("查询成功",statisticsMapper.findhero(playerId));
    }
    @Resource
    MatchClient matchClient;

    @RequestMapping("selectByPlayerId")
    public Result selectByPlayerId(@RequestParam("player_id") String playerId){
        return Result.success("查询成功",matchClient.selectByPlayerId(playerId));
    }

}
